
program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
a,b,c,min,i:integer;

begin
  read(a,b,c);
  if a>b then
    if b>c then min:=c else min:=b
  else if a>c then min:=c else min:=a;

  for i:=2 to min do
  if (a mod i=0) and (b mod i=0) and (c mod i=0) then write(i, ' ');
  readln;
  readln;

end.
